home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacFormat España 20
/
macformat_20.iso
/
mac
/
Shareware
/
Comunicaciones
/
ARACommander 2.1 demo
/
sample connection script
< prev
Wrap
Text File
|
1993-12-30
|
2KB
|
77 lines
tell application "ARAScripter"
(* Set some basic connection parameters (Required if access is not Guest Access) *)
Set RegisteredUser
Set UserName "tester" (* your name *)
Set UserPassword "tester" (* your password *)
Set PhoneNumber "779-7760" (* your phone number *)
(* Set Redial characteristics (Optional) *)
Set RedialTimes 10
Set RedialInterval 10
(*
Set some Modem characteristics (Optional).
Modem characteristics not set default to those
last set, or those set with Remote Access Setup control panel.
*)
Set SpeakerOn
Set PortName "Modem Port"
(* Set a sound to play at connection (Optional) *)
Set ConnectSound "Sosumi"
(* Set connection to disconnect after idle for n minutes or so (Optional) *)
Set IdleDisconnect 1
(*
Make the Connect call. A Connect is called asynchronously,
meaning that other processes can get CPU time while we
loop until we find that the connection process has completed.
Returns 0 if connection started,
or 1 if already connected.
*)
if (Connect) = 0 then
(*
Call GetConnectResultCode in a repeat loop.
Returns:a negative number if an error occured
0 if connection succesful
1 if still in process of connecting
2 if in redial mode
*)
repeat
set connectResult to (Get ConnectResultCode)
if (connectResult < 1) then exit repeat
end repeat
if (connectResult = 0) then
(* successful connection! You could open other applications and documents here*)
(*
loop and Get ConnectionStatus to see when we disconnect
AppleScript note: You may want to call
Get ConnectStatus in an idle handler instead
of a repeat loop if you are writing a standalone
AppleScript application. Get ConnectStatus
really only needs to be called about once
every one or two seconds.
*)
repeat
set connectStatus to (Get ConnectionStatus)
if (connectStatus = 0) then exit repeat
end repeat
if (connectStatus = 0) then
(* successful disconnection. You could do post-connection stuff here *)
end if
end if
end if
end tell